package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.CustomerSourceMapper;
import com.ruoyi.crm.domain.CustomerSource;
import com.ruoyi.crm.service.ICustomerSourceService;

/**
 * 销售线索Service业务层处理
 *
 * @author fjc
 * @date 2021-08-24
 */
@Service
public class CustomerSourceServiceImpl implements ICustomerSourceService
{
    @Autowired
    private CustomerSourceMapper customerSourceMapper;

    /**
     * 查询销售线索
     *
     * @param id 销售线索主键
     * @return 销售线索
     */
    @Override
    public CustomerSource selectCustomerSourceById(String id)
    {
        return customerSourceMapper.selectCustomerSourceById(id);
    }

    /**
     * 查询销售线索列表
     *
     * @param customerSource 销售线索
     * @return 销售线索
     */
    @Override
    public List<CustomerSource> selectCustomerSourceList(CustomerSource customerSource)
    {
        return customerSourceMapper.selectCustomerSourceList(customerSource);
    }

    /**
     * 新增销售线索
     *
     * @param customerSource 销售线索
     * @return 结果
     */
    @Override
    public int insertCustomerSource(CustomerSource customerSource)
    {
        return customerSourceMapper.insertCustomerSource(customerSource);
    }

    /**
     * 修改销售线索
     *
     * @param customerSource 销售线索
     * @return 结果
     */
    @Override
    public int updateCustomerSource(CustomerSource customerSource)
    {
        customerSource.setUpdateTime(DateUtils.getNowDate());
        return customerSourceMapper.updateCustomerSource(customerSource);
    }

    /**
     * 批量删除销售线索
     *
     * @param ids 需要删除的销售线索主键
     * @return 结果
     */
    @Override
    public int deleteCustomerSourceByIds(String[] ids)
    {
        return customerSourceMapper.deleteCustomerSourceByIds(ids);
    }

    /**
     * 删除销售线索信息
     *
     * @param id 销售线索主键
     * @return 结果
     */
    @Override
    public int deleteCustomerSourceById(String id)
    {
        return customerSourceMapper.deleteCustomerSourceById(id);
    }
}